package com.ocm.tourism.core.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TableGenerator;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.Index;
import org.springframework.beans.factory.annotation.Configurable;

@Entity
@Configurable
public class AuditInfo {

   @Id
   @GeneratedValue(strategy=GenerationType.TABLE,generator="GEN_AUDITINFO")
   @TableGenerator(name = "GEN_AUDITINFO", table = "SEQUENCE_LIST", allocationSize = 1, initialValue = 1, pkColumnName = "NAME", valueColumnName = "NEXT_SEQUENCE", pkColumnValue = "AUDITINFO")
   @Column(name = "id")
   private Long id;
   
   private String sessionid;

   private String loggeduser;

   private Date accessedDate;

   private Long businessId;

   @Index(name="INDEX_AUDIT_KEY",columnNames={"auditKey"}) private String auditKey;
   
   @Enumerated(EnumType.STRING)
   private BusinessType businessType;

   public Long getBusinessId() {
      return businessId;
   }

   public void setBusinessId(Long businessId) {
      this.businessId = businessId;
   }

   public BusinessType getBusinessType() {
      return businessType;
   }

   public void setBusinessType(BusinessType businessType) {
      this.businessType = businessType;
   }

   public String getSessionid() {
      return sessionid;
   }

   public void setSessionid(String sessionid) {
      this.sessionid = sessionid;
   }

   public String getLoggeduser() {
      return loggeduser;
   }

   public void setLoggeduser(String loggeduser) {
      this.loggeduser = loggeduser;
   }

   public Date getAccessedDate() {
      return accessedDate;
   }

   public void setAccessedDate(Date accessedDate) {
      this.accessedDate = accessedDate;
   }

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public String getAuditKey() {
      return auditKey;
   }

   public void setAuditKey(String auditKey) {
      this.auditKey = auditKey;
   }

   public String toString() {
      return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
   }
}
